home *** CD-ROM | disk | FTP | other *** search
/ NetNews Offline 2 / NetNews Offline Volume 2.iso / news / comp / lang / c++-part1 / 9319 < prev    next >
Encoding:
Internet Message Format  |  1996-08-05  |  1.2 KB

  1. Path: wdl1.wdl.loral.com!dst17!mab
  2. From: mab@dst17.wdl.loral.com (Mark A Biggar)
  3. Newsgroups: comp.lang.ada,comp.lang.c++
  4. Subject: Re: on OO differnces between Ada95 and C++
  5. Date: 29 Feb 1996 23:58:29 GMT
  6. Organization: Loral Western Development Labs
  7. Distribution: world
  8. Message-ID: <4h5ej5$168@wdl1.wdl.loral.com>
  9. References: <4gh204$l7n@qualcomm.com> <DnDuA4.8GC@bton.ac.uk> <4gvk2b$sjq@watnews1.watson.ibm.com>
  10. NNTP-Posting-Host: dst17.wdl.loral.com
  11.  
  12. In article <4gvk2b$sjq@watnews1.watson.ibm.com> ncohen@watson.ibm.com writes:
  13. >In article <DnDuA4.8GC@bton.ac.uk>, je@bton.ac.uk (John English) writes: 
  14. >|> Nasser Abbasi (nabbasi@qualcomm.com) wrote: 
  15. >Furthermore, for the convenience of its clients, X can contain a
  16. >declaration such as
  17. >
  18. >   subtype T is Y.T;
  19. >
  20. >which causes X to reexport the type originally declared in Y.  Then X's
  21. >client can refer to the type (as X.T) without a with clause for Y.
  22.  
  23. How does this interact with "use type T;"?
  24.  
  25. Does the following work?
  26.  
  27. package A is
  28.     type T is new integer;
  29.     function "+"(L,R: T) return T;
  30. end A;
  31.  
  32. with A;
  33. package B is
  34.     subtype T is A.T;
  35. end B;
  36.  
  37. with B;
  38. procedure C is
  39.     X: B.T;
  40.     use type B.T;
  41. begin
  42.     X := X + X;   --- what "+" operator do I get here if any?
  43. end C;
  44.  
  45. --
  46. Mark Biggar
  47. mab@wdl.loral.com
  48.  
  49.  
  50.  
  51.